package Test;

import java.util.Scanner;

public class DuiChengString {
    public static void main(String[] args) {
        //键盘接收一个字符串，程序判断出该字符串是否是对称字符串
        //并在控制台打印是或1不是

        //1.键盘接收一个字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str = sc.next();

        //2.反转
        String result = new StringBuilder(str).reverse().toString();
        System.out.println(result);

        //3.判断比较
        if (str.equals(result)){
            System.out.println("是对称的");
        }else {
            System.out.println("不是对称的");
        }

    }
}
